package com.asiainfo.dacp.datastash.worker.executor.adapter.datax.model.plugin;

import org.springframework.beans.BeanUtils;

import com.google.common.collect.Lists;

import lombok.Data; 

@Data 
public class MysqlWriter extends RdbmsWriter{
	
	/**
	 * 控制写入数据到目标表采用 insert into 或者 replace into 或者 ON DUPLICATE KEY UPDATE 语句
	 */
	private String writeMode = "insert";
	
	public MysqlWriter(RdbmsWriter rdbmsWriter){
		BeanUtils.copyProperties(rdbmsWriter, this);
	}
	
	
	public static void main(String[] args) {
		RdbmsWriter rdbmsWriter = new RdbmsWriter();
		rdbmsWriter.setBatchSize(11111);
		rdbmsWriter.setColumn(Lists.newArrayList("a"));
		
		MysqlWriter mysqlWriter = new MysqlWriter(rdbmsWriter);
		mysqlWriter.getColumn().add("d");
		System.out.println(rdbmsWriter.getColumn().size());
		System.out.println(mysqlWriter.getColumn().size());
	}
	
}
